include ../global.mk

LIBNAME=../libmonitor.a

CSOURCES=commands.c disasm.c monitor.o readline.o srec.o

CFLAGS+=-I..

OBJECTS=$(CSOURCES:.c=.o)

all: $(LIBNAME)

.c.o:
	$(CC) $(CFLAGS) -o$@ $<

$(LIBNAME): $(OBJECTS)
	$(AR) rcs $(LIBNAME) $(OBJECTS)

clean:
	rm -f $(LIBNAME) $(OBJECTS)

commands.o: commands.c commands.h command.h disasm.o srec.o ../memory/kmalloc.h ../memory/kmalloc.c
disasm.o: disasm.c disasm.h ../kutil/kutil.h ../libkutil.a
monitor.o: monitor.c monitor.h command.h commands.o ../kutil/kutil.h \
		   ../memory/kmalloc.h ../memory/kmalloc.c
readline.o: readline.c readline.h ../duart.h
srec.o: srec.c srec.h readline.o ../kutil/kutil.h ../libkutil.a

